package utils

import (
	"github.com/gin-gonic/gin"
	"vueAdmin/application/errCode"
)

type BackLoginData struct {
	Token string `json:"token"`
}

type BackMenuData struct {
	List []interface{} `json:"list"`
}

type BackPageData struct {
	List        []map[string]string `json:"list"`
	CurrentPage int                 `json:"currentPage"`
	Total       int                 `json:"total"`
	PageSize    int                 `json:"pageSize"`
}

func SetAllCustomData(code int, data interface{}, msg string) gin.H {
	return gin.H{
		"code": code,
		"data": data,
		"msg":  msg,
	}
}

func SetPackageData(code int, data interface{}) gin.H {
	return gin.H{
		"code": code,
		"data": data,
		"msg":  errCode.GetErrMsg(code),
	}
}
